﻿
Partial Class Admin_SiteSettings
    Inherits System.Web.UI.Page


    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        If Not IsPostBack Then
            LoadData()
        End If

    End Sub
    Private Sub LoadData()

        chkAllowManualRegistration.Checked = SiteSettings.AllowManualRegistration
        chkRequireLogin.Checked = SiteSettings.RequireLogin
        txtSiteMessage.Text = SiteSettings.SiteMessage
        chkOnlyAdminsCanEdit.Checked = SiteSettings.OnlyAdminsCanEdit
        chkAutoApproveUsers.Checked = SiteSettings.AutoApproveUsers
    End Sub
    Protected Sub btnSave_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnSave.Click
        SiteSettings.AllowManualRegistration = chkAllowManualRegistration.Checked
        SiteSettings.RequireLogin = chkRequireLogin.Checked
        SiteSettings.SiteMessage = txtSiteMessage.Text
        SiteSettings.OnlyAdminsCanEdit = chkOnlyAdminsCanEdit.Checked
        SiteSettings.AutoApproveUsers = chkAutoApproveUsers.Checked
        SiteSettings.Save()
        LoadData()
    End Sub

End Class
